import java.util.HashSet;
import java.util.Scanner;

public class demo01 {
    //全排列(dfs)
    public static HashSet<String> set=new HashSet<>();
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        char[] arr=str.toCharArray();
        boolean[] num=new boolean[arr.length];
        StringBuilder s=new StringBuilder();
        dfs(arr,num,0,s);
        System.out.println(set);
    }
    public static void dfs(char[] arr,boolean[] num,int index,StringBuilder s){
        if(index==arr.length){
            set.add(s.toString());
        }
        for (int i = 0; i < arr.length; i++) {
            if(!num[i]){
                s.append(arr[i]);
                num[i]=true;
                dfs(arr,num,index+1,s);
                num[i]=false;
                s.deleteCharAt(index);
            }
        }
    }
}
